package com.tongji.housediy.view.component3D
{
	import alternativa.engine3d.core.Vertex;
	import alternativa.engine3d.materials.Material;
	import alternativa.engine3d.objects.Mesh;
	
	import flash.geom.Point;
	
	public class Door extends Mesh
	{
		public var position:Point;
		public var isTwoSide:int;
		public function Door(point1x:Number, point1y:Number, point2x:Number, point2y:Number, height:Number, material:Material)
		{
			this.position = new Point((point1x + point2x)/2, (point1y + point2y)/2); 
			
			var v1:Vertex = this.addVertex(point1x, point1y, 0, 0, 0);
			var v2:Vertex = this.addVertex(point2x, point2y, 0, 1, 0);
			var v3:Vertex = this.addVertex(point2x, point2y, height, 1, 1);
			var v4:Vertex = this.addVertex(point1x, point1y, height, 0, 1);
			this.addFace(Vector.<Vertex>([v1, v2, v3, v4]), material);
			this.calculateFacesNormals();
		}
	}
}